Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This merge request moves all of the code demo snippets in the
docs/
from their.rst
files into individual Python files indocs/code_demos/
. These are then included in the pages using the sphinx methodliteralinclude
. This means that it is easier for us to spot formatting errors in these scripts, largely because now we can run them againstflake8
.Description
For this to be achieved, a number of changes have been made to the directory structure in
docs/
regarding Python files:docs/code_demos/
, with individual directories within it for each page: e.g.docs/code_demos/load/
docs/code_demos/
.rst
files which were considered a complete script (i.e. included correct imports for it to work) have been put into individual Python scripts in their respective sub-directory withindocs/code_demos/
Some additional changes have also been made to support these changes:
.rst
files including these snippetsdocs/code_demos/
have been updated to beflake8
compliantflake8
configuration has been updated to account for lintingdocs/code_demos/
Acceptance Criteria
sphinx-build -a docs/ docs/_build
, all pages which include code snippets should include the correct Python file